﻿CREATE PROCEDURE [dbo].[GetEntryCountPriorToLastBillingDate]
@projectID INT
AS
BEGIN
	SELECT     COUNT(*)
	FROM         EntryLog AS e INNER JOIN
	                  Projects AS p ON e.ProjectID = p.ProjectID
	WHERE     (e.BillingStateID <> 3) AND (e.EntryDate < p.BilledAsOf) AND (p.ProjectID = @projectID)
END

